//
//  accountDetailController.m
//  SSSAllRollAgency
//
//  Created by Darker on 2017/3/15.
//  Copyright © 2017年 Darker. All rights reserved.
//

#import "accountDetailController.h"
#import "commonCell.h"
#import "personInfoController.h"
#import "setDealPaswordController.h"
#import "reviseLoginPaswordController.h"
#import "dealPasWordController.h"
@interface accountDetailController ()<UITableViewDelegate,UITableViewDataSource>
{
    
    NSArray *_dataArray;
    UITableView *_tableView;
}

@end
static NSString *accountDetailID    = @"accountDetailID";
@implementation accountDetailController
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    self.title = @"账户详情";
    //去掉透明后导航栏下边的黑边
    //    [self.navigationController.navigationBar setShadowImage:[[UIImage alloc] init]];
    self.navigationController.navigationBar.hidden = NO;
    self.view.backgroundColor = [UIColor colorWithHex:@"F9F9FA"];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    
    _dataArray = @[@"个人资料",@"交易密码",@"修改登录密码"];
    [self setUpApperance];
    //[self setQuitBtn];
}
- (void)setQuitBtn{
    
    
}
- (void)setUpApperance{
    
    _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0,64+ HeigthIos6CompeteWithCurrent(14), KSCREEN_Width, HeigthIos6CompeteWithCurrent(150)) style:UITableViewStylePlain];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    _tableView.bounces = NO;
    _tableView.backgroundColor = [UIColor colorWithHex:@"FFFFFF"];
    [self.view addSubview:_tableView];
    _tableView.rowHeight = HeigthIos6CompeteWithCurrent(50);
    _tableView.contentInset = UIEdgeInsetsMake(-64, 0, 0, 0);
    
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return _dataArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    Class currentClass = [commonCell class];
    
    commonCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass(currentClass)];
    if (!cell) {
        cell = [[commonCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:accountDetailID];
    }
    cell.nameLabel.text = _dataArray[indexPath.row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    if (indexPath.row == 2) {
        cell.lineView.hidden = YES;
    }
        
    //cell.nameLabel.text = _selectedDataArray[indexPath.row];
    return cell;

    
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    if (indexPath.row == 0) {
        personInfoController *infoVc = [[personInfoController alloc]init];
        [self.navigationController pushViewController:infoVc animated:YES];
    }else if (indexPath.row == 1){
        
        dealPasWordController *dealPaswordVc = [[dealPasWordController alloc]init];
        [self.navigationController pushViewController:dealPaswordVc animated:YES];
        
    }else if (indexPath.row == 2){
        
        reviseLoginPaswordController *reviseVc = [[reviseLoginPaswordController alloc]init];
        reviseVc.titleString = @"修改登录密码";
        [self.navigationController pushViewController:reviseVc animated:YES];
    }
}
@end
